package com.linkgie.galaxyframework.httpproxy;

/**
 * HTTP 请求异常；
 * 
 * 通过 HTTP Service Proxy 调用产生的异常都将包装为 {@link HttpRequestException} 抛出；
 * 
 * 注：操作方法通过 throws 关键字声明的异常除外，这些异常将原样抛出；
 * 
 * @author haiq
 *
 */
public class HttpRequestException extends RuntimeException {

	private int statusCode;

	private String statusMessage;

	public HttpRequestException() {
	}

	public HttpRequestException(String message) {
		super(message);
	}

	public HttpRequestException(String message, Throwable cause) {
		super(message, cause);
	}

	public HttpRequestException(int stautsCode, String statusMessage, String errorMessage) {
		super(errorMessage);
		this.statusCode = stautsCode;
		this.statusMessage = statusMessage;
	}

	public HttpRequestException(int stautsCode, String statusMessage, String errorMessage, Throwable cause) {
		super(errorMessage, cause);
		this.statusCode = stautsCode;
		this.statusMessage = statusMessage;
	}

	/**
	 * @return the stautsCode
	 */
	public int getStatusCode() {
		return statusCode;
	}

	/**
	 * @return the statusMessage
	 */
	public String getStatusMessage() {
		return statusMessage;
	}

}
